
#include "stdio.h"
#include "string"
#include "Muc3_const.h"

using namespace std;

CTextBlock::CTextBlock()
{
}

CTextBlock::CTextBlock(char test[])
{
    this->pText = new char[strlen(test)];
    sprintf(this->pText,test);
}

CTextBlock::~CTextBlock()
{
    if(pText)
        delete pText;
}


 std::size_t CTextBlock::length() const
{
  if (!lengthIsValid) {
    textLength = std::strlen(pText);  // error! can't assign to textLength
    lengthIsValid = true;             // and lengthIsValid in a const
  }                                   // member function
  return textLength;

}

